Skip to content

rework time zone support to set DatabaseFeatures.supports_timezones = False #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

timgraham
Copy link
Collaborator

@timgraham timgraham commented May 30, 2024

Previously, incorrect values were stored in the database.

Copy link
Contributor

@Jibola Jibola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last question but everything else LGTM

Comment on lines +218 to +291
"timezones.tests.NewDatabaseTests.test_cursor_execute_accepts_naive_datetime",
"timezones.tests.NewDatabaseTests.test_cursor_execute_returns_naive_datetime",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand why the new test we skip is the naive version. So we will no longer support naive datetime instead?

Or is it that the naive tests were the original ones that should have been failing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which tests run is controlled by DatabaseFeatures.supports_timezones, i.e. some tests are decorated with @skipUnlessDBFeature("supports_timezones") or @skipIfDBFeature("supports_timezones").

These are the tests that run when supports_timezones = False but we can't run them on MongoDB because they use SQL.

… False

Previously, incorrect values were stored in the database.
@timgraham timgraham force-pushed the supports_timezones branch from 173c21e to 78fd337 Compare June 5, 2024 20:48
@timgraham timgraham merged commit 78fd337 into mongodb:main Jun 5, 2024
3 checks passed
@timgraham timgraham deleted the supports_timezones branch June 5, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants